home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue67 / construc / drbob42.idl < prev    next >
Encoding:
Text File  |  2001-01-31  |  816 b   |  47 lines

  1. module DrBob42
  2. {
  3.   interface Rates
  4.   {
  5.     float interest_rate();
  6.     void SetRate(in float rate);
  7.   };
  8.  
  9.   typedef float Money;
  10.  
  11.   enum AccountType
  12.   {
  13.     normal,
  14.     saving
  15.   };
  16.  
  17.   struct NormalAccount
  18.   {
  19.     Money balance;
  20.   };
  21.  
  22.   struct SavingAccount
  23.   {
  24.     Money balance;
  25.     Rates rates; // interface
  26.   };
  27.  
  28.   union NormalOrSavingAccount switch (AccountType)
  29.   {
  30.     case normal:
  31.       NormalAccount accountN;
  32.     case saving:
  33.       SavingAccount accountS;
  34.   };
  35.  
  36.   const unsigned long ArraySize = 3;
  37.   typedef NormalOrSavingAccount AccountArray[ArraySize];
  38.  
  39.   typedef sequence<NormalOrSavingAccount> AccountSequence;
  40.  
  41.   interface Accounts
  42.   {
  43.     void AccountArrayTest(in AccountArray Accounts);
  44.     void AccountSequenceTest(in AccountSequence Accounts);
  45.   };
  46. };
  47.